<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>


	<table>
		<tr>
			<td>
				时间:
				<input id="b_time4" class="easyui-datebox datebox-f combo-f" style="width: 90px; display: none;" name="btime" type="text">
	
			</td>
			<td> </td>
			<td>
				<a href="javascript:searchCustomer()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
			</td>
		</tr>
	</table>


<table id="aa">

</table>

<table class="easyui-datagrid" id="customerList" title="客户列表"
       data-options="singleSelect:false,collapsible:true,pagination:true,
       url:'${pageContext.request.contextPath }/customer/customerList.action',
       method:'get',
       pageList:[10,30,50],
       pageSize:50,
       rownumbers:true">
    <thead>
        <tr>
        	<th data-options="field:'id',width:100">编号</th>
            <th data-options="field:'customer_name',width:100">客户名</th>
            <th data-options="field:'address',width:100">客户住址</th>
            <th data-options="field:'c_date',width:100">统计日期</th>
            
        </tr>
    </thead>
</table>

<script>
	
    function getSelectionsIds(){
    	var customerList = $("#customerList");
    	var sels = customerList.datagrid("getSelections");
    	var ids = [];
    	for(var i in sels){
    		ids.push(sels[i].id);
    	}
    	ids = ids.join(",");
    	return ids;
    }
    
    var toolbar = [];
    
	function searchCustomer(){
		$("#customerList").datagrid('load',{
			"btime":$("#b_time4").datebox("getValue")
		});
		getXXX($("#b_time4").datebox("getValue"));
	}

	function getXXX(btime){
		$.ajax({
			url:"${pageContext.request.contextPath }/customer/getCount.action",
			async:true,
			data:"btime="+btime,
			success:function(data){
				$("#aa").html("<tr><td>来自北京的人数："+data.count1+"</td></tr><tr><td>来自上海的人数："+data.count2+"</td></tr>"); 
			}
		})
	}
	getXXX("");
    
</script>